@import "mixin_helpers";
@import "variables";

.box {

  @include box-shadow(0 2px 2px -2px #CCC);
  background: $box-background;
  border: 1px solid $box-border-color;
  @include border-radius(3px);
  margin-bottom: 20px;

  .box-header, .box-footer {

    @include clearfix;
    @include box-header-aspect;

    .title {
      float: left;
      display: block;
      padding: 10px;
      font-size: 12px;
      font-weight: 600;
    }

    .box-toolbar {
      margin: 0;
      padding: 0;
      float: right;
      list-style: none;
      
      .ibutton-container {
        margin-top: 6px;
      }

      > li {

        position: relative;
        float: left;
        margin-left: 15px;
        line-height: $header-height;

        ul {
          left: auto;
          right: 0;
        }

        padding-right: 10px;

        &.toolbar-link {
          padding-right: 0;
        }

        &.toolbar-link > a {
          border-left: 1px solid #cecece;
          height: $header-height;
          line-height: $header-height;
          display: block;
          padding: 0 10px;

          i {
            font-size: 16px;
          }

          &:hover {
            @include std-bg(lighten($header-gradient-top, 2), lighten($header-gradient-bottom, 2));
          }

          &:active {
            background: darken($header-gradient-bottom, 2);
          }
        }

        > i {
          font-size: 14px;
          height: $header-height;
          line-height: $header-height;
        }

        &.open > a {
          background: #eee;
        }

        color: $box-header-text-color;
        font-size: 12px;
      }
    }
  }

  .box-header {
    @include border-top-right-radius(3px);
    @include border-top-left-radius(3px);
  }

  .box-footer {
    @include border-bottom-right-radius(3px);
    @include border-bottom-left-radius(3px);
    border-bottom: none;

    border-top: 1px solid #dddddd;

    .pagination {
      margin: 10px 0;
    }

    &.flat {
      border-top: none;
      @include std-bg(#fbfbfb, #f1f1f1);
    }
  }

  .box-content {

  }

}

.box-list {
  list-style: none;
  margin: 0;

  > li {
    @include clearfix;
    @include std-bg($box-background, #f1f1f1);
    @include text-shadow(0 1px #fff);
    padding: 10px;
    border-bottom: 1px solid #ddd;

    &:last-child {
      border-bottom: none;
    }
  }

  .fields li {
    line-height: 23px;
  }

}

//overrides
.box-section {
  border-bottom: 1px solid #ddd;
  border-top: 1px solid #fff;
  padding: 15px;
  @include box-sizing(border-box);

  &:last-child {
    border-bottom: none;
  }
}


//todo: move this out of here
.faded-toolbar {
  a {
    margin-right: 10px;
  }

  &.pull-right {
    a {
      margin-left: 10px;
      margin-right: 0;
    }
  }

  i {
    @include transition(opacity .3s);
    vertical-align: middle;
    color: #989898;
    opacity: .6;
    &:hover { opacity: 1;}
  }
}


//nav tabs overrides

.box {
  .box-header {
    .nav {
      margin-bottom: 0;
    }

    .nav-tabs + .title {
      float: right;
    }

    .nav-tabs {
      border-bottom: none;

      >.active {
        > a, > a:hover {
          background: $box-background;
          border-left-color: #dddddd;
          border-right-color: #dddddd;
          border-top-color: transparent;
          @include border-radius(0);
        }
      }

      &.nav-tabs-left {
        float: left;

        li:first-child a {
          border-left: 0;
          @include border-top-left-radius(3px);
        }
      }

      &.nav-tabs-right {
        float: right;

        li:last-child a {
          border-right: 0;
          @include border-top-right-radius(3px);
          margin-right: 0;
        }
      }
    }

    .nav > li > a:hover {
      border-color: transparent;
      background: none;
    }

  }
}

//generic overrides

.box-header {
  .tooltip {
    line-height: 20px !important;
    text-shadow: none;
  }

  .progress {
    margin-top: 15px;
  }

  .input-with-submit input {
    margin-bottom: 0;
    margin-top: 5px;
  }
}